<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Comment_model extends Xt_model {

	protected $mTable = 'comment';

    public function get_info_by_id($id, $fields='*')
    {
            return $this->get_by_id($id, $fields);
    }
        

    // 删除评论
    public function delCommentById($id) 
    {
        $flag = false;
        if (is_numeric($id) && !empty($id)) {
            $data = array('status' => '-1');
            $flag = $this->update_by_id($id, $data);
        }
        
        return $flag;
    }
    
    // 修改评论
    public function editCommentMemoById($id, $str)
    {
        $flag = false;
        if (is_numeric($id) && !empty($id) && is_string($str)) {
            $data = array('memo' => $str, 'op_time' => time());
            $flag = $this->update_by_id($id, $data);
        }
        
        return $flag;
    }
    
}